home *** CD-ROM | disk | FTP | other *** search
- /* farfree.c --- p. 132 */
- #include <stdio.h>
- #include <alloc.h>
- main()
- {
- int far *bigblock;
- printf("%lu bytes available in the far heap\n", farcoreleft());
- if((bigblock = farmalloc(80000l)) == NULL)
- {
- printf("Memory allocation failed!\n");
- exit(1);
- }
- printf("Block of 80,000 byets allocated at %Fp\n", bigblock);
- printf("%lu bytes available in the far heap "
- "after allocation\n", farcoreleft());
- /* Now free the block */
- farfree(bigblock);
- printf("%lu bytes available in the far heap "
- "after freeing block\n", farcoreleft());
- }